<!--
 * @Author: zhuxiaoyi
 * @Date: 2023-05-18 15:32:44
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2023-08-07 23:12:32
 * @Description: 
-->
<template>
    <div class="display-container" :style="`height:${view.height}px`">
        <div class="display-inner">
            <el-menu :collapse="procesStore.menu.isCollapse" :default-active="state.activeIndex"
                class="el-menu-vertical-demo" @select="handleChange"  :collapse-transition="false"
                background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
            </el-menu>
            <div class="dispaly-main">
                <el-row>
                    <el-col :span="24" class="bread-container">
                        <el-breadcrumb :separator-icon="ArrowRight">
                            <el-breadcrumb-item v-for="item in route.matched">{{ item.meta.title }}</el-breadcrumb-item>
                        </el-breadcrumb>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24" class="main-body" :style="`height:${view.height - 60}px`">
                        <el-row>
                            <el-col :span="24" class="userInfo-container">
                                <div style="width:600px">
                                    <el-descriptions class="margin-top" title="用户信息" :column="2" 
                                        :border="true">
                                        <template #extra>
                                            <el-button type="primary" size="small" disabled>编辑</el-button>
                                        </template>
                                        <el-descriptions-item :span="2">
                                            <template #label>
                                                <div class="cell-item">
                                                    用户名
                                                </div>
                                            </template>
                                            {{ userStore.userInfo.nickname }}
                                        </el-descriptions-item>
                                        <el-descriptions-item :span="2">
                                            <template #label>
                                                <div class="cell-item">
                                                    账号
                                                </div>
                                            </template>
                                            {{ userStore.userInfo.username }}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template #label>
                                                <div class="cell-item">
                                                    性别
                                                </div>
                                            </template>
                                            <el-tag size="small">{{ userStore.userInfo.sex }}</el-tag>
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template #label>
                                                <div class="cell-item">
                                                    年龄
                                                </div>
                                            </template>
                                            {{ userStore.userInfo.age }}
                                        </el-descriptions-item>
                                        <el-descriptions-item :span="2">
                                            <template #label>
                                                <div class="cell-item">
                                                    用户ID
                                                </div>
                                            </template>
                                            {{ userStore.userInfo.id }}
                                        </el-descriptions-item>
                                        <el-descriptions-item :span="2">
                                            <template #label>
                                                <div class="cell-item">
                                                    部门ID
                                                </div>
                                            </template>
                                            {{ userStore.userInfo.deptId }}
                                        </el-descriptions-item>
                                        <el-descriptions-item>
                                            <template #label>
                                                <div class="cell-item">
                                                    用户创建时间
                                                </div>
                                            </template>
                                            {{ userStore.userInfo.createDate }}
                                        </el-descriptions-item>
                                    </el-descriptions>
                                </div>

                            </el-col>
                        </el-row>
                    </el-col>
                </el-row>
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { ref, reactive, computed, watch } from 'vue'
import {
    Document,
    Menu as IconMenu,
    Location,
    Setting, ArrowRight, SuccessFilled, Operation
} from '@element-plus/icons-vue'
import * as _ from "lodash";
import { useUserStore } from '@/store/user'
import { useProcesStore } from '@/store/process'

import router from '@/router';
import { useRoute } from 'vue-router';
const userStore = useUserStore()
const procesStore = useProcesStore()
const route = useRoute()
var view = reactive({
    height: window.innerHeight - 61
})

const state: any = reactive({
    activeIndex: 'publish'
})

const handleChange = function (menu: string) {
    switch (menu) {
        case 'publish':
            router.push('/index/review/publish')
            break;
        default:
            break;
    }
}

window.onresize = _.debounce(() => {
    view.height = window.innerHeight - 61
}, 100)
</script>

<style lang="scss" scoped>
.display-inner {
    display: flex;


    .dispaly-main {
        padding: 15px;
        width: 100%;

        .bread-container {
            height: 30px;
        }

        .main-body {
            background: #fff;
            padding: 20px;
            box-sizing: border-box;
            box-shadow: 0px 12px 32px 4px rgba(0, 0, 0, .04), 0px 8px 20px rgba(0, 0, 0, .08);

            .userInfo-container {
                display: flex;
                justify-content: center;
            }
        }
    }

}
</style>
<style lang="scss"></style>